package chapter4;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description: 对三个城市排序
 * Date:2021/4/2
 * ***************************************************************
 */
public class exc4_24 {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.print("Enter a city name: ");
		String s1=input.nextLine();
		System.out.print("Enter a city name: ");
		String s2=input.nextLine();
		System.out.print("Enter a city name: ");
		String s3=input.nextLine();
		
		if(s1.compareTo(s2)>0) {
			String tmp=s1;
			s1=s2;
			s2=tmp;
		}
		if(s2.compareTo(s3)>0) {
			String tmp=s2;
			s2=s3;
			s3=tmp;
		}
		if(s1.compareTo(s2)>0) {
			String tmp=s1;
			s1=s2;
			s2=tmp;
		}
		System.out.println("The Three cities in alphabetical rder are "+s1+"  "+s2+"  "+s3);
	}

}
